<!DOCTYPE html>
<!-- saved from url=(0045)https://uniapp.dcloud.io/static/web-view.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
		<title></title>
		<style type="text/css">
			.btn {
				display: block;
				margin: 20px auto;
				padding: 5px;
				background-color: #007aff;
				border: 0;
				color: #ffffff;
				height: 40px;
				width: 200px;
			}

			.btn-red {
				background-color: #dd524d;
			}

			.btn-yellow {
				background-color: #f0ad4e;
			}

			.desc {
				padding: 10px;
				color: #999999;
			}

			.post-message-section {
				visibility: hidden;
			}
		</style>
	<script src="chrome-extension://mooikfkahbdckldjjndioackbalphokd/assets/prompt.js"></script></head>
	<body>
		
		<div class="post-message-section" style="visibility: visible;">
			<div class="btn-list">
				<button class="btn btn-red" type="button" id="postMessage2">预览pdf</button>
			</div>
			<div class="btn-list">
				<button class="btn btn-red" type="button" id="postMessage3">预览pdf3</button>
			</div>
			<div class="btn-list">
				<button class="btn btn-red" type="button" id="postMessage4">登录</button>
			</div>
		</div>
		<div class="post-message-section" style="visibility: visible;">
			<div class="btn-list">
				<a href="https://static-b355b199-f26f-4bea-b13c-1b2c8fff663f.bspapp.com/testpdf.pdf">预览pdf</a>
			</div>
		</div>
		<script type="text/javascript">
			var userAgent = navigator.userAgent;
			// alert(/miniProgram/i.test(userAgent) && /micromessenger/i.test(userAgent))
			if (userAgent.indexOf('AlipayClient') > -1) {
				// 支付宝小程序的 JS-SDK 防止 404 需要动态加载，如果不需要兼容支付宝小程序，则无需引用此 JS 文件。
				document.writeln('<script src="https://appx/web-view.min.js"' + '>' + '<' + '/' + 'script>');
			} else if (/QQ/i.test(userAgent) && /miniProgram/i.test(userAgent)) {
				// QQ 小程序
				document.write('<script type="text/javascript" src="https://qqq.gtimg.cn/miniprogram/webview_jssdk/qqjssdk-1.0.0.js"><\/script>');
			} else if (/miniProgram/i.test(userAgent) && /micromessenger/i.test(userAgent)) {
				// 微信小程序 JS-SDK 如果不需要兼容微信小程序，则无需引用此 JS 文件。
				document.write('<script type="text/javascript" src="./jweixin-1.3.2.js"><\/script>');
			} else if (/toutiaomicroapp/i.test(userAgent)) {
				// 头条小程序 JS-SDK 如果不需要兼容头条小程序，则无需引用此 JS 文件。
				document.write('<script type="text/javascript" src="https://s3.pstatp.com/toutiao/tmajssdk/jssdk-1.0.1.js"><\/script>');
			} else if (/swan/i.test(userAgent)) {
				// 百度小程序 JS-SDK 如果不需要兼容百度小程序，则无需引用此 JS 文件。
				document.write('<script type="text/javascript" src="https://b.bdstatic.com/searchbox/icms/searchbox/js/swan-2.0.18.js"><\/script>');
			} else if (/quickapp/i.test(userAgent)) {
				// quickapp
				document.write('<script type="text/javascript" src="https://quickapp/jssdk.webview.min.js"><\/script>');
			}
			if (!/toutiaomicroapp/i.test(userAgent)) {
				document.querySelector('.post-message-section').style.visibility = 'visible';
			}
		</script>
		<!-- uni 的 SDK -->
		<script type="text/javascript" src="./index.js"></script>
		<script type="text/javascript">
			document.addEventListener('UniAppJSBridgeReady', function() {
				document.querySelector('.btn-list').addEventListener('click', function(evt) {
					var target = evt.target;
					if (target.tagName === 'BUTTON') {
						var action = target.getAttribute('data-action');
						switch (action) {
							case 'switchTab':
								uni.switchTab({
									url: '/pages/tabBar/API/API'
								});
								break;
							case 'reLaunch':
								uni.reLaunch({
									url: '/pages/tabBar/component/component'
								});
								break;
							case 'navigateBack':
								uni.navigateBack({
									delta: 1
								});
								break;
							default:
								uni[action]({
									url: '/pages/component/button/button'
								});
								break;
						}
					}
				});
				document.getElementById('postMessage').addEventListener('click', function() {
					
					uni.postMessage({
						data: {
							action: 'message11'
						}
					});
					uni.navigateBack({
						delta: 1
					});
					// uni.redirectTo({
					// 	url:  '/pages/webview/pay_h5'
					// });
					// wx.miniProgram.navigateTo({url: '/pages/webview/pay_h5'})
					// uni.postMessage({
					// 	data: {
					// 		action: 'message22'
					// 	}
					// });
					// wx.miniProgram.getEnv(function(res) { console.log(res) })
					
					//wx.miniProgram.navigateBack();
					// console.log('eee')
					// alert('a111');
					// uni.navigateBack({
					//                   delta: 1
					//                 });
					// uni.switchTab({
					//   url: "/pages/index/my"
					// });	
					// wx.miniProgram.navigateBack();
					// wx.miniProgram.navigateTo({url: '/path/to/page'})
					// wx.miniProgram.postMessage({ data: 'foo' })
					// wx.miniProgram.postMessage({ data: {foo: 'bar'} })
					// wx.miniProgram.getEnv(function(res) { console.log(res.miniprogram) })
					
						//alert('a222');
						
								 	
				});
				
				
				document.getElementById('postMessage2').addEventListener('click', function() {
					
					uni.postMessage({
						data: {
							action: 'pdf'
						}
					});
					uni.navigateBack({
						delta: 1
					});
					
								 	
				});
				
				document.getElementById('postMessage3').addEventListener('click', function() {
					
					
					wx.miniProgram.postMessage({
					data: {
						action: 'pdf'
					}
				  })
				 //  wx.miniProgram.switchTab({
					// url: '/pages/samplepage/demo' // 小程序中页面的路径
				 //  })
				 
					wx.miniProgram.redirectTo({
						url: '/pages/webview/result?d=pdf' // 小程序中页面的路径
					 })	
					 
					 //  wx.miniProgram.navigateTo({
						// url: '/pages/webview/result' // 小程序中页面的路径
					 // })	
									
				});
				document.getElementById('postMessage4').addEventListener('click', function() {
					wx.miniProgram.redirectTo({
						url: '/pages/webview/result?action=login' // 小程序中页面的路径
					 })	
									
				});
			});
		</script>
	

</body></html>